<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:margin-left="http://www.w3.org/1999/xhtml"
      xmlns:margin-right="http://www.w3.org/1999/xhtml" xmlns:text-align="http://www.w3.org/1999/xhtml">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-room-add">
        <div class="form-group">
            <label class="col-sm-3 control-label">房间名称：</label>
            <div class="col-sm-8">
                <input id="name" name="name" class="form-control" placeholder="请输入房间名称" type="text">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">房间类型：</label>
            <div class="col-sm-8">
                <select id="roomType" name="roomType" class="form-control m-b" >
                    <option value="">请选择</option>
                    <option value="2">踩雷房间</option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">红包类型：</label>
            <div class="col-sm-8">
                <select id="redType" name="redType" class="form-control m-b"  onchange="getType(this.value)">
                    <option value="">请选择</option>
                    <option value="1">单雷</option>
                    <option value="2">多雷</option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">房间群主：</label>
            <div class="col-sm-8">
                <select id="roomBossId" name="roomBossId" class="form-control m-b">
                  <!--  <option value="">所有</option>-->
                    <option th:each="ordinary:${ordinaryList}" th:text="${ordinary.nickName}"
                            th:value="${ordinary.id}"></option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">房间密码：</label>
            <div class="col-sm-8">
                <input id="password" name="password" class="form-control" placeholder="请输入房间密码" type="text">
            </div>
        </div>

        <div class="form-group" id="oddMoneyMinId">
            <label class="col-sm-3 control-label">单雷金额范围最小：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="oddMoneyMin" id="oddMoneyMin" maxlength="30"
                       placeholder="请输入金额范围最小"
                       onkeyup="value=value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g,'')"/>
            </div>
        </div>
        <div class="form-group" id="oddMoneyMaxId">
            <label class="col-sm-3 control-label">单雷金额范围最大：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="oddMoneyMax" id="oddMoneyMax" maxlength="30"
                       placeholder="请输入金额范围最大"
                       onkeyup="value=value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g,'')"/>
            </div>
        </div>

        <div class="form-group" id="oddAmountId">
            <label class="col-sm-3 control-label">单雷红包数量：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="oddAmount" id="oddAmount" maxlength="30" placeholder="请输入红包数量"
                       onkeyup="value=value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g,'')"/>
            </div>
        </div>

        <div class="form-group" id="oddOneLeiId">
            <label class="col-sm-3 control-label">单雷赔率：</label>
            <div class="col-sm-8">
                <input id="oddOneLei" name="oddOneLei" class="form-control"
                       placeholder="1代表百分1,请输入0~100以内百分数"/>
            </div>
        </div>

        <div style="text-align: center"  id="line">
            <label  style="text-align: center" >--多雷参数--</label>
        </div>

        <div class="form-group" id="evenMoneyMinId">
            <label class="col-sm-3 control-label">多雷金额范围最小：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="evenMoneyMin" id="evenMoneyMin" maxlength="30"
                       placeholder="请输入金额范围最小"
                       onkeyup="value=value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g,'')"/>
            </div>
        </div>
        <div class="form-group" id="evenMoneyMaxId">
            <label class="col-sm-3 control-label">多雷金额范围最大：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="evenMoneyMax" id="evenMoneyMax" maxlength="30"
                       placeholder="请输入金额范围最大"
                       onkeyup="value=value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g,'')"/>
            </div>
        </div>

        <div class="form-group" id="evenAmountId">
            <label class="col-sm-3 control-label">多雷红包数量：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="evenAmount" id="evenAmount" maxlength="30" placeholder="请输入红包数量"
                       onkeyup="value=value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g,'')"/>
            </div>
        </div>


        <div class="form-group" id="oneLeiId">
            <label class="col-sm-3 control-label">单雷赔率：</label>
            <div class="col-sm-8">
                <input id="oneLei" name="oneLei" class="form-control"
                       placeholder="1代表百分1,请输入0~100以内百分数"/>
            </div>
        </div>

        <div class="form-group" id="twoLeiId">
            <label class="col-sm-3 control-label">双雷赔率：</label>
            <div class="col-sm-8">
                <input id="twoLei" name="twoLei" class="form-control"
                       placeholder="1代表百分1,请输入0~100以内百分数"
                       />
            </div>
        </div>

        <div class="form-group" id="threeLeiId">
            <label class="col-sm-3 control-label">三雷赔率：</label>
            <div class="col-sm-8">
                <input id="threeLei" name="threeLei" class="form-control"
                       placeholder="1代表百分1,请输入0~100以内百分数"
                       />
            </div>
        </div>

        <div class="form-group" id="fourLeiId">
            <label class="col-sm-3 control-label">四雷赔率：</label>
            <div class="col-sm-8">
                <input id="fourLei" name="fourLei" class="form-control"
                       placeholder="1代表百分1,请输入0~100以内百分数"
                       />
            </div>
        </div>

        <div class="form-group" id="fiveLeiId">
            <label class="col-sm-3 control-label">五雷赔率：</label>
            <div class="col-sm-8">
                <input id="fiveLei" name="fiveLei" class="form-control"
                       placeholder="1代表百分1,请输入0~100以内百分数"
                       />
            </div>
        </div>

        <div class="form-group" id="sixLeiId">
            <label class="col-sm-3 control-label">六雷赔率：</label>
            <div class="col-sm-8">
                <input id="sixLei" name="sixLei" class="form-control"
                       placeholder="1代表百分1,请输入0~100以内百分数"
                       />
            </div>
        </div>

        <div class="form-group" id="sevenLeiId">
            <label class="col-sm-3 control-label">七雷赔率：</label>
            <div class="col-sm-8">
                <input id="sevenLei" name="sevenLei" class="form-control"
                       placeholder="1代表百分1,请输入0~100以内百分数"
                       />
            </div>
        </div>

        <div class="form-group" id="eightLeiId">
            <label class="col-sm-3 control-label">八雷赔率：</label>
            <div class="col-sm-8">
                <input id="eightLei" name="eightLei" class="form-control"
                       placeholder="1代表百分1,请输入0~100以内百分数"
                       />
            </div>
        </div>

        <div class="form-group" id="nineLeiId">
            <label class="col-sm-3 control-label">九雷赔率：</label>
            <div class="col-sm-8">
                <input id="nineLei" name="nineLei" class="form-control"
                       placeholder="1代表百分1,请输入0~100以内百分数"/>
            </div>
        </div>

    </form>
</div>
<div th:include="include::footer"></div>
<div th:include="tool/upload/webuploader :: webuploader"></div>
<script th:src="@{/ajax/libs/select/select2.js}"></script>
<script type="text/javascript">
    var prefix = ctx + "module/room";
    $("#form-room-add").validate({
        rules: {
            name: {
                required: true,
            },
            roomType: {
                required: true,
            },
            redType: {
                required: true,
            }
        },
        messages :{
            "name": {
                remote: "不能为空"
            },
        }

    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-room-add').serialize());
        }
    }

    function getType(Flag){
        if(Flag.trim() == 1){

            $("#line").hide();
            $("#evenMoneyMinId").hide();
            $("#evenMoneyMaxId").hide();
            $("#evenAmountId").hide();
            $("#oneLeiId").hide();
            $("#twoLeiId").hide();
            $("#threeLeiId").hide();
            $("#fourLeiId").hide();
            $("#fiveLeiId").hide();
            $("#sixLeiId").hide();
            $("#sevenLeiId").hide();
            $("#eightLeiId").hide();
            $("#nineLeiId").hide();
        }else{
            $("#line").show();
            $("#evenMoneyMinId").show();
            $("#evenMoneyMaxId").show();
            $("#evenAmountId").show();
            $("#oneLeiId").show();
            $("#twoLeiId").show();
            $("#threeLeiId").show();
            $("#fourLeiId").show();
            $("#fiveLeiId").show();
            $("#sixLeiId").show();
            $("#sevenLeiId").show();
            $("#eightLeiId").show();
            $("#nineLeiId").show();
        }
    }

</script>
</body>
</html>
